var e = require("../../utils/compare-version"), t = getApp().globalData.systemInfo, a = t.SDKVersion, o = t.version, i = t.platform, n = t.statusBarHeight, r = void 0 === n ? 20 : n, s = 0 <= (0, 
e.compareVersion)(a, "1.7.0") && 0 <= (0, e.compareVersion)(o, "6.6.0");

Component({
    properties: {
        title: {
            type: String,
            value: ""
        },
        light: {
            type: Boolean,
            value: !1
        },
        showHome: {
            type: Boolean,
            value: !0
        },
        bgColor: {
            type: String,
            value: "#fff"
        },
        fontColor: {
            type: String,
            value: "#000"
        },
        navBGColor: {
            type: String,
            value: "#FFFFFF"
        },
        isHomePage: {
            type: Boolean,
            value: !1
        },
        showCancel: {
            type: Boolean,
            value: !1
        }
    },
    data: {
        showBack: !1,
        showComponent: s,
        statusBarHeight: r,
        platform: i,
        height: "android" === i ? 48 : 42
    },
    attached: function() {
        var e = {
            showBack: 1 < getCurrentPages().length
        };
        this.properties.isHomePage && (e.height = this.data.height - 5), this.setData(e);
        var t = this.data, a = t.statusBarHeight, o = t.height, i = t.showComponent ? a + o : 0;
        this.triggerEvent("navbarHeight", i);
    },
    methods: {
        handleNavBack: function() {
            wx.navigateBack();
        },
        handleNavToHome: function() {
            wx.reLaunch({
                url: "/bh_bargain/pages/group/group"
            });
        },
        handleTitleTap: function() {
            this.triggerEvent("titleTap");
        }
    }
});